//
//  ZNWBTextController.swift
//  ZNWeibo
//
//  Created by FunctionMaker on 2017/9/1.
//  Copyright © 2017年 FunctionMaker. All rights reserved.
//

import UIKit

class ZNWBTextController: UIViewController {
    
    /// 标题视图 - 换行 option + 回车
    @IBOutlet var titleLabel: UILabel!
    /// 发布按钮
    @IBOutlet var sendButton: UIButton!
    /// 微博正文视图
    @IBOutlet weak var contentTextView: UITextView!
    /// 底部工具栏
    @IBOutlet weak var bottomToolBar: UIToolbar!

    override func viewDidLoad() {
        super.viewDidLoad()
        
        setupUI()
    }
    
    /// MARK: - 发布微博
    @IBAction func sendStatus(_ sender: UIButton) {
        
    }
}

private extension ZNWBTextController {
    func setupUI() {
        view.backgroundColor = UIColor.white
        
        setupNavigationItem()
    }
    
    func setupNavigationItem() {
        navigationItem.leftBarButtonItem = UIBarButtonItem(title: "关闭", target: self, action: #selector(close), event: .touchUpInside)
        navigationItem.rightBarButtonItem = UIBarButtonItem(customView: sendButton)
        navigationItem.titleView = titleLabel
        
        sendButton.isEnabled = false
    }
    
    @objc private func close() {
        dismiss(animated: true, completion: nil)
    }
}
